/** 单表树 */
const Mock = require('better-mock');
const DemoTreeData = Mock.mock({
  errorDesc: '',
  message: '',
  retCode: '200',
  responseBody: [
    {
      id: '8a58df8c875458660187545866740000',
      parentId: '-1',
      title: '根节点',
      selectable: true,
      disableCheckbox: false,
      isLeaf: false,
      disabled: false,
      orgIdentity: 'ORG_ROOT',
      attributes: {
        treeLevel: 1,
        treeLeaf: 'N',
        treePath: '8a58df8c875458660187545866740000'
      },
      children: [
        {
          id: '8a58df8c87545d370187546a1fe60002',
          parentId: '8a58df8c875458660187545866740000',
          title: 'gtest1',
          selectable: true,
          disableCheckbox: false,
          isLeaf: false,
          disabled: false,
          orgIdentity: 'ORG_ROOT',
          attributes: {
            treeLevel: 2,
            treeLeaf: 'N',
            treePath: '8a58df8c875458660187545866740000'
          }
        },
        {
          id: '8a69d4d9878e11680187c2533f0803c3',
          parentId: '8a58df8c875458660187545866740000',
          title: 'gmx',
          selectable: true,
          disableCheckbox: false,
          isLeaf: false,
          disabled: false,
          orgIdentity: 'ORG_ROOT',
          attributes: {
            treeLevel: 2,
            treeLeaf: 'N',
            treePath: '8a58df8c875458660187545866740000'
          }
        },
        {
          id: '8a69ef5a876efaec01876f0e90360012',
          parentId: '8a58df8c875458660187545866740000',
          title: '子节点02',
          selectable: true,
          disableCheckbox: false,
          isLeaf: true,
          disabled: false,
          orgIdentity: 'ORG_ROOT',
          attributes: {
            treeLevel: 2,
            treeLeaf: 'Y',
            treePath: '8a58df8c875458660187545866740000'
          }
        },
        {
          id: '8a69efa68823111901884cdef5980295',
          parentId: '8a58df8c875458660187545866740000',
          title: '的胜多负少的',
          selectable: true,
          disableCheckbox: false,
          isLeaf: false,
          disabled: false,
          orgIdentity: 'ORG_ROOT',
          attributes: {
            treeLevel: 2,
            treeLeaf: 'N',
            treePath: '8a58df8c875458660187545866740000'
          }
        },
        {
          id: '8a58da02875659150187565e215d000c',
          parentId: '8a58df8c875458660187545866740000',
          title: '访问3',
          selectable: true,
          disableCheckbox: false,
          isLeaf: false,
          disabled: false,
          orgIdentity: 'ORG_ROOT',
          attributes: {
            treeLevel: 2,
            treeLeaf: 'N',
            treePath: '8a58df8c875458660187545866740000'
          }
        },
        {
          id: '8a69e6bf8898f05d018899a5f2c9006c',
          parentId: '8a58df8c875458660187545866740000',
          title: 'wefwef',
          selectable: true,
          disableCheckbox: false,
          isLeaf: false,
          disabled: false,
          orgIdentity: 'ORG_ROOT',
          attributes: {
            treeLevel: 2,
            treeLeaf: 'N',
            treePath: '8a58df8c875458660187545866740000'
          }
        },
        {
          id: '8a58df8c8755192b0187554c1fbc007b',
          parentId: '8a58df8c875458660187545866740000',
          title: '根节点的子节点',
          selectable: true,
          disableCheckbox: false,
          isLeaf: false,
          disabled: false,
          orgIdentity: 'ORG_ROOT',
          attributes: {
            treeLevel: 2,
            treeLeaf: 'N',
            treePath: '8a58df8c875458660187545866740000'
          }
        }
      ]
    }
  ]
});
/** 编辑数据 */
const getDemoTreeData = Mock.mock({
  errorDesc: '',
  message: 'ok',
  retCode: '200',
  responseBody: {
    id: '@id',
    /** 父节点id */
    parentId: '-1',
    /** 节点名称 */
    demoTitle: '根节点',
    /** 必填 */
    demoNotnull: '@cname()',
    /** 用户 */
    demoUserIdAlias: 'test',
    /** 部门 */
    demoDeptIdAlias: '研发中心',
    /** 角色 */
    demoRoleIdAlias: '一般用户',
    /** 群组 */
    demoGroupIdAlias: '测试',
    /** 岗位 */
    demoPositionIdAlias: '测试岗位',
    /** 单选 */
    demoRadio: '2',
    demoRadioName: '女',
    /** 单选（按钮样式） */
    demoRadioButtonName: '数值',
    /** 复选 */
    demoCheckboxName: '数值',
    /** 下拉 */
    demoSelect: '001',
    demoSelectName: '研究生',
    /** 下拉多选 */
    demoSelectMultiple: '1',
    demoSelectMultipleName: '日期',
    /** 开关 */
    demoSwitch: 'Y',
    /** 小数 */
    demoNumber: '@float',
    /** 整数 */
    demoInteger: '@integer',
    /** 日期 */
    demoDate: '@date',
    /** 时间 */
    demoDateTime: '@datetime',
    /** 电话(正则) */
    demoPhone: /^1(5|3|7|8)[0-9]{9}$/,
    /** 邮件(正则) */
    demoEmail: 'mm17768528@163.com',
    /** 网址(正则) */
    demoWebsite: "@url('http')",
    /** 唯一值 */
    demoUnique: '@string',
    /** 弹窗 */
    demoModalSelect: '@csentence(5)',
    demoModalSelectAlias: '@csentence(5)',
    /** 多行文本 */
    demoTextarea: '@cparagraph',
    /** 富文本 */
    demoRichtext: '@cparagraph',
    /** 编码 */
    demoCode: 'DEMO-202306-0110',
    /** 密级 */
    secretLevel: '1',
    secretLevelName: '非涉密文档',
    /** 排序 */
    treeSort: '1'
  }
});
module.exports = {
  'GET /demo/template/demotrees/get-tree': DemoTreeData,
  'POST /demo/template/demotrees/get': getDemoTreeData
};
